//
//  CalculateViewController.m
//  DanaKreditLoan
//
//  Created by ZhengChengFeng on 2024/10/18.
//

#import "CalculateViewController.h"
#import "CalculateTableViewCell.h"

#define kTabCell     @"kTabCell"

@interface CalculateViewController ()

@property (nonatomic) NSString *rateString,*monthString;
@property (nonatomic) NSInteger loanAmounInt;

@property (nonatomic) UITextField *textFiled;
@property (nonatomic) UILabel *totalInterestLab,*totalRepayLab;
@property (nonatomic) CalculateModel *model;

@property (nonatomic) UIButton *termBtn1,*termBtn2,*termBtn3,*termLastBtn;

@property (nonatomic) UIButton *rateBtn1,*rateBtn2,*rateBtn3,*rateLastBtn;

@end

@implementation CalculateViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

- (void)clickSubmit{

    [BoxLoadingHelper showBoxLoadingWithMessage:@""];
    NSString *newS = [self.rateString substringToIndex:self.rateString.length - 1];
    
    NSMutableDictionary *muDic = @{
        @"yearningly":@(self.loanAmounInt),
        @"closing":esString(newS),
        @"exceptionally":@([self.monthString integerValue]),
        @"wandered":@(0),
    }.mutableCopy;
    [HttpNetHelper getNetworkHelperForPath:kCalculateUrl parameter:muDic onCompleteSuccess:^(NSDictionary * _Nonnull responseDic) {
        [BoxLoadingHelper hideBoxLoading];
        if ([responseDic[@"pineapples"] integerValue] != kSuccessCode) {
            [BoxLoadingHelper showBoxWithMessage:esString(responseDic[@"shin"])];
            return;
        }
        
        NSDictionary *dic = responseDic[@"clip"];
        self.model = [CalculateModel mj_objectWithKeyValues:dic];
        
        if (isArray(dic[@"clip"])) {
            NSArray *arr = dic[@"clip"];
            self.data = [CalculateModel mj_objectArrayWithKeyValuesArray:arr];
        }
       
        
        self.totalInterestLab.text = [NSString countNumForThreeformat:esString(self.model.teaspoon)];
        self.totalRepayLab.text = [NSString countNumForThreeformat:esString(self.model.pencils)];
                
        [self.tableView reloadData];
        
    } onCompleteFailur:^(NSError * _Nonnull error) {
        [BoxLoadingHelper hideBoxLoading];
    } withIsForm:YES];
    
}

- (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"Interest Calculation";
    
    UIView *topV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kNavigationBarHeight)];
    [self.view addSubview:topV];
    
    UILabel *lab = [UILabel createLabel:[UIFont fontWithName:kFuturaMedium size:16] color:kBlackColor];
    lab.text = @"Interest Calculation";
    lab.textAlignment = 1;
    lab.frame = CGRectMake(0, kNavigationBarHeight -  DimensionBaseIphone6(40), kScreenWidth, DimensionBaseIphone6(30));
    [topV addSubview:lab];
    
    self.tableView.frame = CGRectMake(0, kNavigationBarHeight, kScreenWidth, kScreenHeight - kNavigationBarHeight);
    
    [self initHeadView];
    
    [self.tableView registerClass:[CalculateTableViewCell class] forCellReuseIdentifier:kTabCell];
}

- (void)initHeadView{
    UIView *headView = [[UIView alloc] init];
    self.tableView.tableHeaderView = headView;
    
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, DimensionBaseIphone6(140))];
    imgView.image = [UIImage imageNamed:@"icon_calculate1"];
    [headView addSubview:imgView];
    
    UIView *backV = [[UIView alloc] init];
    backV.backgroundColor = kTableViewBackColor;
    [headView addSubview:backV];
    backV.frame = CGRectMake(0, imgView.bottom - 30, kScreenWidth, DimensionBaseIphone6(372+48+20));
    backV.layer.mask = [NSString UIBezierPathWithRect:backV.bounds withCorners:UIRectCornerTopLeft|UIRectCornerTopRight withRadiu:CGSizeMake(14, 14)];
    
    headView.frame = CGRectMake(0, 0, kScreenWidth, DimensionBaseIphone6(110+372+48+20));
    
    
    UIView *whiteV = [[UIView alloc] initWithFrame:CGRectMake(15, 15, kScreenWidth - 30, DimensionBaseIphone6(337))];
    [backV addSubview:whiteV];
    whiteV.backgroundColor = [UIColor whiteColor];
    whiteV.layer.cornerRadius = 14;
    whiteV.layer.masksToBounds = YES;
    
    UIView *shadeV1 = [[UIView alloc] init];
    shadeV1.frame = CGRectMake(15, DimensionBaseIphone6(18), whiteV.width - 30, DimensionBaseIphone6(54));
    [whiteV addSubview:shadeV1];
    shadeV1.backgroundColor = kTableViewBackColor;
    shadeV1.layer.cornerRadius = 14;
    shadeV1.layer.masksToBounds = YES;
    shadeV1.layer.borderColor = [UIColor colorWithHexString:@"#EFEFEF"].CGColor;
    shadeV1.layer.borderWidth = 1;
    
    UIView *shadeV2 = [[UIView alloc] init];
    shadeV2.frame = CGRectMake(15, DimensionBaseIphone6(20) + shadeV1.bottom, whiteV.width - 30, DimensionBaseIphone6(54));
    [whiteV addSubview:shadeV2];
    shadeV2.backgroundColor = kTableViewBackColor;
    shadeV2.layer.cornerRadius = 14;
    shadeV2.layer.masksToBounds = YES;
    shadeV2.layer.borderColor = [UIColor colorWithHexString:@"#EFEFEF"].CGColor;
    shadeV2.layer.borderWidth = 1;
    
    UIView *shadeV3 = [[UIView alloc] init];
    shadeV3.frame = CGRectMake(15, DimensionBaseIphone6(20)+shadeV2.bottom, whiteV.width - 30, DimensionBaseIphone6(54));
    [whiteV addSubview:shadeV3];
    shadeV3.backgroundColor = kTableViewBackColor;
    shadeV3.layer.cornerRadius = 14;
    shadeV3.layer.masksToBounds = YES;
    shadeV3.layer.borderColor = [UIColor colorWithHexString:@"#EFEFEF"].CGColor;
    shadeV3.layer.borderWidth = 1;
    
    UIView *shadeV4 = [[UIView alloc] init];
    shadeV4.frame = CGRectMake(15, DimensionBaseIphone6(20)+shadeV3.bottom, whiteV.width - 30, DimensionBaseIphone6(80));
    [whiteV addSubview:shadeV4];
    shadeV4.backgroundColor = kTableViewBackColor;
    shadeV4.layer.cornerRadius = 14;
    shadeV4.layer.masksToBounds = YES;
    shadeV4.layer.borderColor = [UIColor colorWithHexString:@"#EFEFEF"].CGColor;
    shadeV4.layer.borderWidth = 1;
    
    UIButton *calculateBtn = [[UIButton alloc] initWithFrame:CGRectMake(15, whiteV.bottom + DimensionBaseIphone6(20), backV.width - 30, DimensionBaseIphone6(48))];
    [backV addSubview:calculateBtn];
    calculateBtn.backgroundColor = kButtonDefaultColor;
    calculateBtn.layer.cornerRadius = DimensionBaseIphone6(24);
    calculateBtn.layer.masksToBounds = YES;
    calculateBtn.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:15];
    [calculateBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
    [calculateBtn setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [calculateBtn setTitleColor:kWhiteColor forState:UIControlStateHighlighted];
    [calculateBtn setTitle:@"Calculate" forState:UIControlStateNormal];
    [calculateBtn setTitle:@"Calculate" forState:UIControlStateSelected];
    [calculateBtn setTitle:@"Calculate" forState:UIControlStateHighlighted];
    [calculateBtn setImage:[UIImage imageNamed:@"icon_login2"] forState:UIControlStateNormal];
    [calculateBtn setImage:[UIImage imageNamed:@"icon_login2"] forState:UIControlStateSelected];
    [calculateBtn setImage:[UIImage imageNamed:@"icon_login2"] forState:UIControlStateHighlighted];
    [calculateBtn addTarget:self action:@selector(clickSubmit) forControlEvents:UIControlEventTouchUpInside];
    [calculateBtn setImgRightTitltLeft:10];
    
    [self initLoanAmount:shadeV1];
    [self initLoanTerm:shadeV2];
    [self initInterestRate:shadeV3];
    [self initTotal:shadeV4];
    
    [self clickSubmit];
    
}

- (void)initLoanAmount:(UIView *)shadeV{
    
    UILabel *lab = [UILabel createLabel:[UIFont fontWithName:kFutura size:13] color:kBlackColor];
    [shadeV addSubview:lab];
    lab.frame = CGRectMake(15, DimensionBaseIphone6(15), 200, DimensionBaseIphone6(24));
    lab.text = @"Loan Amount";
    
    UIButton *plusBtn = [[UIButton alloc] initWithFrame:CGRectMake(shadeV.width - 15 - DimensionBaseIphone6(22), DimensionBaseIphone6(54-22)/2, DimensionBaseIphone6(22), DimensionBaseIphone6(22))];
    [plusBtn setImage:[UIImage imageNamed:@"icon_calculate4"] forState:UIControlStateNormal];
    [plusBtn setImage:[UIImage imageNamed:@"icon_calculate4"] forState:UIControlStateNormal];
    [plusBtn setImage:[UIImage imageNamed:@"icon_calculate4"] forState:UIControlStateNormal];
    [shadeV addSubview:plusBtn];
    
    
    self.textFiled = [[UITextFieldHelper alloc] init];
    self.textFiled.font = [UIFont fontWithName:kFuturaBT size:16];
    self.textFiled.textColor = kBlackColor;
    self.textFiled.textAlignment = 1;
    self.textFiled.keyboardType = UIKeyboardTypeNumberPad;
    [shadeV addSubview:self.textFiled];
    self.textFiled.frame = CGRectMake(plusBtn.left - 100, 0, 100, DimensionBaseIphone6(54));
        
    self.textFiled.enabled = NO;
    
    UIButton *minusBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.textFiled.left - DimensionBaseIphone6(22), DimensionBaseIphone6(54-22)/2, DimensionBaseIphone6(22), DimensionBaseIphone6(22))];
    [minusBtn setImage:[UIImage imageNamed:@"icon_calculate3"] forState:UIControlStateNormal];
    [minusBtn setImage:[UIImage imageNamed:@"icon_calculate3"] forState:UIControlStateNormal];
    [minusBtn setImage:[UIImage imageNamed:@"icon_calculate3"] forState:UIControlStateNormal];
    [shadeV addSubview:minusBtn];
    
    
    [plusBtn addTarget:self action:@selector(clickPlusBtn) forControlEvents:UIControlEventTouchUpInside];
    [minusBtn addTarget:self action:@selector(clickMinusBtn) forControlEvents:UIControlEventTouchUpInside];
   
    self.loanAmounInt = 1000000;
    self.textFiled.text = [NSString countNumForThreeformat:[NSString stringWithFormat:@"%ld",self.loanAmounInt]];
    
}

- (void)clickPlusBtn{
    self.loanAmounInt += 500000;
    if (self.loanAmounInt >= 8500000) {
        self.loanAmounInt = 8500000;
    }
    self.textFiled.text = [NSString countNumForThreeformat:[NSString stringWithFormat:@"%ld",self.loanAmounInt]];
}

- (void)clickMinusBtn{
    self.loanAmounInt -= 500000;
    if (self.loanAmounInt <= 1000000) {
        self.loanAmounInt = 1000000;
    }
    self.textFiled.text = [NSString countNumForThreeformat:[NSString stringWithFormat:@"%ld",self.loanAmounInt]];
}

- (void)initLoanTerm:(UIView *)shadeV{
    UILabel *lab = [UILabel createLabel:[UIFont fontWithName:kFutura size:13] color:kBlackColor];
    [shadeV addSubview:lab];
    lab.frame = CGRectMake(15, DimensionBaseIphone6(15), 200, DimensionBaseIphone6(24));
    lab.text = @"Loan Term(months)";
    
    self.termBtn3 = [[UIButton alloc] initWithFrame:CGRectMake(shadeV.width - 15 - 44, DimensionBaseIphone6(54-28)/2, 44, DimensionBaseIphone6(28))];
    self.termBtn3.layer.cornerRadius = DimensionBaseIphone6(14);
    self.termBtn3.layer.masksToBounds = YES;
    [shadeV addSubview:self.termBtn3];
    [self.termBtn3 setTitle:@"12" forState:UIControlStateNormal];
    [self.termBtn3 setTitle:@"12" forState:UIControlStateSelected];
    [self.termBtn3 setTitle:@"12" forState:UIControlStateHighlighted];
    self.termBtn3.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:12];
    

    self.termBtn3.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.termBtn3.layer.borderWidth = 0.5;
    [self.termBtn3 setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [self.termBtn3 setTitleColor:kBlackColor forState:UIControlStateNormal];

    [self.termBtn3 addTarget:self action:@selector(clickTermBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    
    self.termBtn2 = [[UIButton alloc] initWithFrame:CGRectMake(self.termBtn3.left - 49, DimensionBaseIphone6(54-28)/2, 44, DimensionBaseIphone6(28))];
    self.termBtn2.layer.cornerRadius = DimensionBaseIphone6(14);
    self.termBtn2.layer.masksToBounds = YES;
    [shadeV addSubview:self.termBtn2];
    [self.termBtn2 setTitle:@"6" forState:UIControlStateNormal];
    [self.termBtn2 setTitle:@"6" forState:UIControlStateSelected];
    [self.termBtn2 setTitle:@"6" forState:UIControlStateHighlighted];
    self.termBtn2.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:12];

    self.termBtn2.backgroundColor = [UIColor whiteColor];
    self.termBtn2.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.termBtn2.layer.borderWidth = 0.5;
    [self.termBtn2 setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [self.termBtn2 setTitleColor:kBlackColor forState:UIControlStateNormal];
    [self.termBtn2 addTarget:self action:@selector(clickTermBtn:) forControlEvents:UIControlEventTouchUpInside];


    self.termBtn1 = [[UIButton alloc] initWithFrame:CGRectMake(self.termBtn2.left - 49, DimensionBaseIphone6(54-28)/2, 44, DimensionBaseIphone6(28))];
    self.termBtn1.layer.cornerRadius = DimensionBaseIphone6(14);
    self.termBtn1.layer.masksToBounds = YES;
    [shadeV addSubview:self.termBtn1];
    [self.termBtn1 setTitle:@"3" forState:UIControlStateNormal];
    [self.termBtn1 setTitle:@"3" forState:UIControlStateSelected];
    [self.termBtn1 setTitle:@"3" forState:UIControlStateHighlighted];
    self.termBtn1.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:12];

    self.termBtn1.backgroundColor = [UIColor whiteColor];
    self.termBtn1.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.termBtn1.layer.borderWidth = 0.5;
    [self.termBtn1 setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [self.termBtn1 setTitleColor:kBlackColor forState:UIControlStateNormal];
    [self.termBtn1 addTarget:self action:@selector(clickTermBtn:) forControlEvents:UIControlEventTouchUpInside];

    self.termBtn3.tag = 3;
    self.termBtn2.tag = 2;
    self.termBtn1.tag = 1;

    self.termBtn1.selected = YES;
    self.termLastBtn = self.termBtn1;
    [self clickTermBtn:self.termBtn1];
}

- (void)clickTermBtn:(UIButton *)btn{
    
    self.termLastBtn.selected = NO;
    
    self.termLastBtn.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.termLastBtn.backgroundColor = kWhiteColor;
    
    btn.selected = YES;
    
    self.termLastBtn = btn;
    
    self.termLastBtn.layer.borderColor = [UIColor clearColor].CGColor;
    self.termLastBtn.backgroundColor = kButtonDefaultColor;
    
    self.monthString = [NSString stringWithFormat:@"%@",esString(btn.titleLabel.text)];
    
}


- (void)initInterestRate:(UIView *)shadeV{
    UILabel *lab = [UILabel createLabel:[UIFont fontWithName:kFutura size:13] color:kBlackColor];
    [shadeV addSubview:lab];
    lab.frame = CGRectMake(15, DimensionBaseIphone6(15), 200, DimensionBaseIphone6(24));
    lab.text = @"Interest Rate(day)";
    
    
    
    self.rateBtn3 = [[UIButton alloc] initWithFrame:CGRectMake(shadeV.width - 15 - 48, DimensionBaseIphone6(54-28)/2, 48, DimensionBaseIphone6(28))];
    self.rateBtn3.layer.cornerRadius = DimensionBaseIphone6(14);
    self.rateBtn3.layer.masksToBounds = YES;
    [shadeV addSubview:self.rateBtn3];
    [self.rateBtn3 setTitle:@"0.04%" forState:UIControlStateNormal];
    [self.rateBtn3 setTitle:@"0.04%" forState:UIControlStateSelected];
    [self.rateBtn3 setTitle:@"0.04%" forState:UIControlStateHighlighted];
    self.rateBtn3.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:12];
    

    self.rateBtn3.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.rateBtn3.layer.borderWidth = 0.5;
    [self.rateBtn3 setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [self.rateBtn3 setTitleColor:kBlackColor forState:UIControlStateNormal];

    [self.rateBtn3 addTarget:self action:@selector(clickRateBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    
    self.rateBtn2 = [[UIButton alloc] initWithFrame:CGRectMake(self.rateBtn3.left - 53, DimensionBaseIphone6(54-28)/2, 48, DimensionBaseIphone6(28))];
    self.rateBtn2.layer.cornerRadius = DimensionBaseIphone6(14);
    self.rateBtn2.layer.masksToBounds = YES;
    [shadeV addSubview:self.rateBtn2];
    [self.rateBtn2 setTitle:@"0.03%" forState:UIControlStateNormal];
    [self.rateBtn2 setTitle:@"0.03%" forState:UIControlStateSelected];
    [self.rateBtn2 setTitle:@"0.03%" forState:UIControlStateHighlighted];
    self.rateBtn2.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:12];

    self.rateBtn2.backgroundColor = [UIColor whiteColor];
    self.rateBtn2.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.rateBtn2.layer.borderWidth = 0.5;
    [self.rateBtn2 setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [self.rateBtn2 setTitleColor:kBlackColor forState:UIControlStateNormal];
    [self.rateBtn2 addTarget:self action:@selector(clickRateBtn:) forControlEvents:UIControlEventTouchUpInside];


    self.rateBtn1 = [[UIButton alloc] initWithFrame:CGRectMake(self.rateBtn2.left - 53, DimensionBaseIphone6(54-28)/2, 48, DimensionBaseIphone6(28))];
    self.rateBtn1.layer.cornerRadius = DimensionBaseIphone6(14);
    self.rateBtn1.layer.masksToBounds = YES;
    [shadeV addSubview:self.rateBtn1];
    [self.rateBtn1 setTitle:@"0.02%" forState:UIControlStateNormal];
    [self.rateBtn1 setTitle:@"0.02%" forState:UIControlStateSelected];
    [self.rateBtn1 setTitle:@"0.02%" forState:UIControlStateHighlighted];
    self.rateBtn1.titleLabel.font = [UIFont fontWithName:kFuturaMedium size:12];

    self.rateBtn1.backgroundColor = [UIColor whiteColor];
    self.rateBtn1.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.rateBtn1.layer.borderWidth = 0.5;
    [self.rateBtn1 setTitleColor:kWhiteColor forState:UIControlStateSelected];
    [self.rateBtn1 setTitleColor:kBlackColor forState:UIControlStateNormal];
    [self.rateBtn1 addTarget:self action:@selector(clickRateBtn:) forControlEvents:UIControlEventTouchUpInside];

    self.rateBtn3.tag = 3;
    self.rateBtn2.tag = 2;
    self.rateBtn1.tag = 1;

    self.rateBtn1.selected = YES;
    self.rateLastBtn = self.rateBtn1;
    [self clickRateBtn:self.rateBtn1];
    
    
}

- (void)clickRateBtn:(UIButton *)btn{
    
    self.rateLastBtn.selected = NO;
    
    self.rateLastBtn.layer.borderColor = [UIColor colorWithHexString:@"#6C6C6C"].CGColor;
    self.rateLastBtn.backgroundColor = kWhiteColor;
    
    btn.selected = YES;
    
    self.rateLastBtn = btn;
    
    self.rateLastBtn.layer.borderColor = [UIColor clearColor].CGColor;
    self.rateLastBtn.backgroundColor = kButtonDefaultColor;
    
    self.rateString = [NSString stringWithFormat:@"%@",esString(btn.titleLabel.text)];
}


- (void)initTotal:(UIView *)shadeV{
    
    UILabel *lab1 = [UILabel createLabel:[UIFont fontWithName:kFutura size:13] color:kBlackColor];
    lab1.text = @"Total Interest";
    [shadeV addSubview:lab1];
    lab1.frame = CGRectMake(15, DimensionBaseIphone6(10), 100, DimensionBaseIphone6(30));
    
    UILabel *lab2 = [UILabel createLabel:[UIFont fontWithName:kFutura size:13] color:kBlackColor];
    lab2.text = @"Total Repayment";
    [shadeV addSubview:lab2];
    lab2.frame = CGRectMake(15, lab1.bottom, 100, DimensionBaseIphone6(30));
    
    
    self.totalInterestLab = [UILabel createLabel:[UIFont fontWithName:kFutura size:14] color:kBlackColor];
    [shadeV addSubview:self.totalInterestLab];
    self.totalInterestLab.textAlignment = 2;
    self.totalInterestLab.frame = CGRectMake(shadeV.width - 15 - 200, 0, 200, DimensionBaseIphone6(30));
    self.totalInterestLab.centerY = lab1.centerY;
    
    
    self.totalRepayLab = [UILabel createLabel:[UIFont fontWithName:kFutura size:14] color:kBlackColor];
    [shadeV addSubview:self.totalRepayLab];
    self.totalRepayLab.textAlignment = 2;
    self.totalRepayLab.frame = CGRectMake(shadeV.width - 15 - 200, 0, 200, DimensionBaseIphone6(30));
    self.totalRepayLab.centerY = lab2.centerY;
    
    
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.data.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    CalculateTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kTabCell];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    cell.mod =  self.data[indexPath.row];

    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}



@end
